<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

    protected function _initRouter()
    {
        $this->bootstrap("frontController");
        $front = $this->getResource("frontController");
        //Read the routes from an ini file and in that ini file use the options with routes prefix...
        $this->bootstrap("frontController");
        $front = $this->getResource("frontController");
        $front->getRouter()->addConfig(
            new Zend_Config_Ini(APPLICATION_PATH . "/configs/routes.ini"), "routes"
        );
    }

    protected function _initDoctype()
    {
        $this->bootstrap('view');
        $view = $this->getResource('view');
        $view->doctype('XHTML1_STRICT');

        //$bootstrap = $this->bootstrap();
        //$this->bootstrap('layout');

        $options = $this->getOptions();

        foreach ( $options['resources'] as $config )  {
            if ( isset( $config['styles'] ) ) {
                foreach( $config['styles']  as $style ){
                    $view->headLink()->appendStylesheet( $style );
                }
            }

            if ( isset( $config['scripts'] ) ) {
                foreach( $config['scripts'] as $script ){
                    $view->headScript()->appendFile( $script );
                }
            }

            if ( isset( $config['title'] ) ) {
                $view->headTitle( $options['title'] );
            }

        }
    }

}